import { IsNotEmpty, IsNumber, IsString } from 'class-validator';
import { Type } from 'class-transformer';

export class LocateErrorDto {
  @IsNotEmpty({ message: 'sourcemapId不能为空' })
  @Type(() => Number)
  @IsNumber({}, { message: 'sourcemapId必须是数字' })
  sourcemapId: number;

  @IsNotEmpty({ message: 'bugId不能为空' })
  @IsString({ message: 'bugId必须是字符串' })
  bugId: string;

  @IsNotEmpty({ message: '错误行数不能为空' })
  @Type(() => Number)
  @IsNumber({}, { message: '错误行数必须是数字' })
  line: number;

  @IsNotEmpty({ message: '错误列数不能为空' })
  @Type(() => Number)
  @IsNumber({}, { message: '错误列数必须是数字' })
  column: number;
}
